import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/monitor/person_monitoring_page_entity_entity.dart';

PersonMonitoringPageEntityEntity $PersonMonitoringPageEntityEntityFromJson(Map<String, dynamic> json) {
  final PersonMonitoringPageEntityEntity personMonitoringPageEntityEntity = PersonMonitoringPageEntityEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    personMonitoringPageEntityEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    personMonitoringPageEntityEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    personMonitoringPageEntityEntity.companyName = companyName;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    personMonitoringPageEntityEntity.name = name;
  }
  final int? sex = jsonConvert.convert<int>(json['sex']);
  if (sex != null) {
    personMonitoringPageEntityEntity.sex = sex;
  }
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    personMonitoringPageEntityEntity.phone = phone;
  }
  final String? idCard = jsonConvert.convert<String>(json['idCard']);
  if (idCard != null) {
    personMonitoringPageEntityEntity.idCard = idCard;
  }
  final String? groupId = jsonConvert.convert<String>(json['groupId']);
  if (groupId != null) {
    personMonitoringPageEntityEntity.groupId = groupId;
  }
  final int? craft = jsonConvert.convert<int>(json['craft']);
  if (craft != null) {
    personMonitoringPageEntityEntity.craft = craft;
  }
  final String? craftStr = jsonConvert.convert<String>(json['craftStr']);
  if (craftStr != null) {
    personMonitoringPageEntityEntity.craftStr = craftStr;
  }
  final String? enterTime = jsonConvert.convert<String>(json['enterTime']);
  if (enterTime != null) {
    personMonitoringPageEntityEntity.enterTime = enterTime;
  }
  final String? exitTime = jsonConvert.convert<String>(json['exitTime']);
  if (exitTime != null) {
    personMonitoringPageEntityEntity.exitTime = exitTime;
  }
  final PersonMonitoringPageEntityTrajectory? trajectory = jsonConvert.convert<PersonMonitoringPageEntityTrajectory>(json['trajectory']);
  if (trajectory != null) {
    personMonitoringPageEntityEntity.trajectory = trajectory;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    personMonitoringPageEntityEntity.createTime = createTime;
  }
  return personMonitoringPageEntityEntity;
}

Map<String, dynamic> $PersonMonitoringPageEntityEntityToJson(PersonMonitoringPageEntityEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['name'] = entity.name;
  data['sex'] = entity.sex;
  data['phone'] = entity.phone;
  data['idCard'] = entity.idCard;
  data['groupId'] = entity.groupId;
  data['craft'] = entity.craft;
  data['craftStr'] = entity.craftStr;
  data['enterTime'] = entity.enterTime;
  data['exitTime'] = entity.exitTime;
  data['trajectory'] = entity.trajectory?.toJson();
  data['createTime'] = entity.createTime;
  return data;
}

extension PersonMonitoringPageEntityEntityExtension on PersonMonitoringPageEntityEntity {
  PersonMonitoringPageEntityEntity copyWith({
    int? id,
    int? companyId,
    String? companyName,
    String? name,
    int? sex,
    String? phone,
    String? idCard,
    String? groupId,
    int? craft,
    String? craftStr,
    String? enterTime,
    String? exitTime,
    PersonMonitoringPageEntityTrajectory? trajectory,
    String? createTime,
  }) {
    return PersonMonitoringPageEntityEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..name = name ?? this.name
      ..sex = sex ?? this.sex
      ..phone = phone ?? this.phone
      ..idCard = idCard ?? this.idCard
      ..groupId = groupId ?? this.groupId
      ..craft = craft ?? this.craft
      ..craftStr = craftStr ?? this.craftStr
      ..enterTime = enterTime ?? this.enterTime
      ..exitTime = exitTime ?? this.exitTime
      ..trajectory = trajectory ?? this.trajectory
      ..createTime = createTime ?? this.createTime;
  }
}

PersonMonitoringPageEntityTrajectory $PersonMonitoringPageEntityTrajectoryFromJson(Map<String, dynamic> json) {
  final PersonMonitoringPageEntityTrajectory personMonitoringPageEntityTrajectory = PersonMonitoringPageEntityTrajectory();
  return personMonitoringPageEntityTrajectory;
}

Map<String, dynamic> $PersonMonitoringPageEntityTrajectoryToJson(PersonMonitoringPageEntityTrajectory entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension PersonMonitoringPageEntityTrajectoryExtension on PersonMonitoringPageEntityTrajectory {
}